import type { RouteRecordRaw } from "vue-router";
/**
 * 路由meta对象参数说明
 * meta: {
 *      title:          菜单栏及 tagsView 栏、菜单搜索名称（国际化）
 *      hidden：        是否隐藏此路由
 *      icon：          菜单、tagsView 图标，阿里：加 `iconfont xxx`，fontawesome：加 `fa xxx`
 * }
 */

/**
 * 静态路由（默认路由）
 */
export const staticRoutes: Array<RouteRecordRaw> = [
    {
        path: "/login",
        name: "Login",
        component: () => import("@/page/login/index.vue"),
    },
    {
        path: "/404",
        name: "404",
        component: () => import("@/page/error/404.vue"),
    },
    {
        path: "/index",
        name: "Index",
        component: () => import("@/page/index/index.vue"),
        meta: { title: "中舞网_爱一格旗下舞蹈网" },
        children: [
            {
                name: "Recommend",
                path: "/index/recommend",
                component: () =>
                    import("@/page/index/children/recommend/index.vue"),
            },
            {
                path: "/index",
                redirect: "/index/recommend",
            },
            {
                //作品
                name: "Production",
                path: "/index/production",
                component: () =>
                    import("@/page/index/children/production/index.vue"),
            },
            {
                //教程
                name: "Course",
                path: "/index/course",
                component: () =>
                    import("@/page/index/children/course/index.vue"),
            },
            {
                //专题
                name: "Soecial",
                path: "/index/soecial",
                component: () =>
                    import("@/page/index/children/soecial/index.vue"),
            },
            {
                //动态
                name: "Dynamic",
                path: "/index/dynamic",
                component: () =>
                    import("@/page/index/children/dynamic/index.vue"),
            },
            {
                //关注
                name: "Focus",
                path: "/index/focus",
                component: () =>
                    import("@/page/index/children/focus/index.vue"),
            },
        ],
    },
    {
        path: "/videoPlay",
        name: "VideoPlay",
        component: () => import("@/page/index/children/videoPlay/index.vue"),
        props: (route) => {
            return {
                momentId: route.query.momentId,
            };
        },
        meta: { title: "视频播放" },
    },
    {
        path: "/course",
        name: "course",
        component: () => import("@/page/course/index.vue"),
        children: [
            {
                path: "/vip_zone",
                name: "vip",
                component: () => import("@/page/course/course.vue"),
            },
            {
                path: "/video_course",
                name: "/video_course",
                component: () => import("@/page/course/video/video.vue"),
            },
            {
                path: "/live_course",
                name: "/live_course",
                component: () => import("@/page/course/live/live.vue"),
            },
            {
                path: "/zone_list",
                name: "theme",
                component: () => import("@/page/course/theme/theme.vue"),
            },
            {
                path: "/course",
                redirect: "/vip_zone",
            },
        ],
    },
    {
        path: "/training",
        name: "training",
        component: () => import("@/page/training/inde.vue"),
        children: [
            {
                path: "/center/view_records",
                component: () =>
                    import("@/page/training/components/history/history.vue"),
            },
            {
                path: "",
                component: () =>
                    import("@/page/training/components/mine/mine.vue"),
            },
            {
                path: "/detail/training",
                component: () =>
                    import("@/page/training/components/mine/detail/detail.vue"),
            },
        ],
    },
    {
        path: "/userHome",
        component: () => import("@/page/userHome/index.vue"),
    },

    {
        path: "/center",
        name: "Center",
        component: () => import("@/page/center/index.vue"),
        children: [
            {
                path: "/center/dynamics",
                name: "Dynamics",
                component: () =>
                    import("@/page/center/components/dynamics/index.vue"),
            },
            {
                path: "/my_member",
                name: "MyMember",
                component: () =>
                    import("@/page/center/components/my_member/index.vue"),
            },
            {
                path: "/center/wallet",
                name: "Wallet",
                component: () =>
                    import("@/page/center/components/wallet/index.vue"),
            },
            {
                path: "/center/coupons",
                name: "Coupons",
                component: () =>
                    import("@/page/center/components/coupons/index.vue"),
            },
            {
                path: "/center/my_order",
                name: "MyOrder",
                component: () =>
                    import("@/page/center/components/my_order/index.vue"),
            },
            {
                path: "/center/edit_info",
                name: "EditInfo",
                component: () =>
                    import("@/page/center/components/edit_info/index.vue"),
            },
            {
                path: "/center/seller/orders_manager",
                name: "OrdersManager",
                component: () =>
                    import("@/page/center/components/orders_manager/index.vue"),
            },
            {
                path: "/center/seller/goods_manager",
                name: "Goods_Manager",
                component: () =>
                    import("@/page/center/components/goods_manager/index.vue"),
            },
            {
                path: "/center/seller/customers_manager",
                name: "CustomersManager",
                component: () =>
                    import(
                        "@/page/center/components/customers_manager/index.vue"
                    ),
            },
            {
                path: "/center/seller/pending_payments_manager",
                name: "PendingPaymentsManager",
                component: () =>
                    import(
                        "@/page/center/components/pending_payments_manager/index.vue"
                    ),
            },
            {
                path: "/center/seller/minePreferentialManagement",
                name: "MinePreferentialManagement",
                component: () =>
                    import(
                        "@/page/center/components/minePreferentialManagement/index.vue"
                    ),
            },
            {
                path: "/center/seller/mineReviewsManagement",
                name: "MineReviewsManagement",
                component: () =>
                    import(
                        "@/page/center/components/mineReviewsManagement/index.vue"
                    ),
            },
            {
                path: "/center/seller/deposit",
                name: "Deposit",
                component: () =>
                    import("@/page/center/components/deposit/index.vue"),
            },
            {
                path: "/center",
                redirect: "/center/dynamics",
            },
        ],
    },
    {
        path: "/edit/PublishPics",
        name: "editDynamics",
        component: () => import("@/page/editDynamics/index.vue"),
    },

    {
        path: "/",
        redirect: "/index",
    },

    /* 匹配任意的路由 必须最后注册 */
    {
        path: "/:pathMatch(.*)",
        name: "Any",
        redirect: "/404",
        meta: {
            hidden: true,
        },
    },
];

/**
 * 定义动态路由
 */
export const allAsyncRoutes: Array<RouteRecordRaw> = [];
